package org.springframework.beans.factory;

import org.springframework.beans.BaseException;

/**
 * @author 山顶洞人郑某
 * @className BeanFactory.java Bean工厂接口
 * @date 2025 04 18
 */
public interface BeanFactory {


    public void register(String beanName,Object bean) throws BaseException;


    public Object getBean(String beanName) throws BaseException;

    /**
     * 根据beanName和beanType获取bean
     * @param beanName
     * @param beanType
     * @return
     * @param <T>
     * @throws BaseException bean不存在
     */
    public <T>T getBean(String beanName,Class<T> beanType) throws BaseException;

    /**
     * 根据beanTyep获取bean
     * @param beanType
     * @return
     * @param <T>
     * @throws BaseException
     */
    public <T>T getBean(Class<T> beanType) throws BaseException;

    public Boolean contanisBean(String name);

}
